const compose = (...fns) => fns.reduce((a, b) => {
    return (...args) => {
      return a(b(...args))
    }
  })
  const compose2 = (...fns) => (value)=>fns.reduce((a, b) => {
      return b(a)
  },value)
  const add5 = x => x + 5
  const sub2 = x => x - 2
  const multiply = (x) => x * 10
  const multiply10AndAdd5AndSub2 = compose2(
    add5,
    sub2,
    multiply
  )
  console.log(multiply10AndAdd5AndSub2(10)); 